package activity.appindex;

import org.shmsa.hst4a.R;

import activity.appother.AppBase;
import activity.appother.app2.ContactsDetail;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class App2 extends AppBase {
	ListView lv;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.app2);
		lv=(ListView)findViewById(R.id.app2_lv);
		String[] types = getResources().getStringArray(R.array.contacts_type);
		lv.setAdapter(new ArrayAdapter<String>(this, R.layout.app2_list_item, types));
		//lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
		lv.setOnItemClickListener(new OnItemClickListener(){

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				//System.out.println(parent+","+view+","+position+","+id);
				Intent next=new Intent(App2.this, ContactsDetail.class);
				next.putExtra("position", position);
				startActivity(next);
			}
			
		});
	}

}
